<template>
  <el-container class="main">

    <el-header class="main-header">
      <nav-header @foldChange="foldChange"></nav-header>
    </el-header>

    <el-container class="page">

      <el-aside width="200px" class="page-aside">
        <nav-menu :collapse="isCollapse"/>
      </el-aside>

      <el-main  class="page-content">
       <div>
          <router-view></router-view>
       </div>
      </el-main>

    </el-container>
  </el-container>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'
import NavHeader from '@/components/nav-header'
import NavMenu from '@/components/nav-menu'
export default defineComponent({
  setup(){
    const isCollapse = ref(false)
    const foldChange = (isFold: boolean) => {
      isCollapse.value = isFold
    }
    return {
      foldChange,
      isCollapse
    }
  }
})
</script>

<style lang="less" scoped>
.main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.main-header {
  position: relative;
  height: 64px;
  line-height: 64px;
  font-size: 22px;
  color: #fff;
  background: #4285f4;
  overflow: hidden;
  box-shadow: inset 2px 0 2px 0 rgb(0 21 41 / 35%);
}
.main-content,
.page {
  height: 100%;
}

.page-content {
  height: calc(100% - 48px);

  .content {
    background-color: #fff;
    border-radius: 8px;
  }
}

.page-aside {
  height: 100%;
}
.el-aside {
  overflow-x: hidden;
  overflow-y: auto;
  line-height: 200px;
  text-align: left;
  cursor: pointer;
  background-color: #fff;
  transition: width 0.3s linear;
  scrollbar-width: none; /* firefox */
  -ms-overflow-style: none; /* IE 10+ */

  &::-webkit-scrollbar {
    display: none;
    width: 0;
  }
}
.el-main {
  color: #333;
  text-align: center;
  background-color: #f0f2f5;
}

</style>
